package com.first.dao.impl;

import com.first.dao.UrlDao;
import com.first.util.DBUtil;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;


public class UrlDaoImpl implements UrlDao {
    @Override
    public int addImgUlr(ArrayList<String> urls, Integer bookid) {
        String sql="insert into url values(?,?)";
        System.out.println(urls);
        for (String url : urls) {
            int i = DBUtil.update(sql,bookid, url);
        }
        String sql1="update book set urlid=? where bookid=?";
        int i = DBUtil.update(sql1, bookid,bookid);
        return i;
    }

    @Override
    public int updateImgUrl(String url1,String url) {
        String sql="update url set url=? where url=?";
        int i = DBUtil.update(sql, url1, url);
        return i;
    }
}
